//define(["jquery","utils","HeatPoint"], function($, utils,HeatPoint){
define(["jquery","utils","heatmap"], function($, utils,h337){
    
    function HeatMapArea(obj) {

        // private stuff
        this.domObj = obj;
       	this.heatPointList= [];
		this.heatmap=null;
        this.Type = null;
        this.myHeatmap = false;
        this.dataStored = false;
    };

    $.extend(HeatMapArea.prototype, {

	    positionHeatmap :function(){

            if(!this.myHeatmap) return;
            var parent = $(this.domObj);
            var position = parent.offset();
            var canvas = $(this.heatmap.get("canvas"));

            canvas.offset(position);
            canvas.css("width",parent.outerWidth( true ));
            canvas.css("height",parent.outerHeight( true ));    
        },
        toggleDisplay : function(){
            this.positionHeatmap();
            this.heatmap.toggleDisplay();
        },
        init: function (opt_heatmap, opt_Radius) {

            if(this.heatmap == null && opt_heatmap ==null ){
                if (opt_Radius == null ) opt_Radius = 15;
                this.heatmap = h337.create({"element":this.domObj, "radius":opt_Radius, "visible":true});
                this.heatmap.toggleDisplay();
                this.myHeatmap = true;
            }

             //Deaktiviert die Darstellung der Heatmap (display: none)     
            else {
                this.heatmap = opt_heatmap;
            }
        }
    });

   return HeatMapArea;
});
